using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_MENU.
    /// </summary>
    public class DM_MENU
    {
              private string _PrID;
      private string _ID;
      private string _PrName;
      private byte[] _PrImage;
      private string _GroupMenuID;
      private string _UnitID1;
      private string _UnitID2;
      private double _Number;
      private double _PrVAT;
      private string _PrMadeIn;
      private decimal _PrPrice_Purchase;
      private decimal _PrPrice_AfterVAT;
      private decimal _PrPrice_RetailSale;
      private decimal _PrPrice_WholeSale;
      private string _Note;
      private string _UserNameCreate;
      private DateTime _DateCreate;
      private string _IDPOS;
      private bool _IsUse;
      private bool _IsDelete;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetPrID; 
      public bool IsPrIDNullable   
      { 
	 get { return false;  } 
      }
      public string PrID
      {
         get { return _PrID; }
         set 
	    { 
 		 _PrID = value;
		IsSetPrID = true;
 	    }
      }
    public bool IsSetID; 
    public bool IsIDNullable   
    { 
		get { return false;  } 
    }
    public string ID
    {
        get{ return _ID;  }
        set
		{
			_ID = value;
			IsSetID = true;
		}
    }
    public bool IsSetPrName; 
    public bool IsPrNameNullable   
    { 
		get { return false;  } 
    }
    public string PrName
    {
        get{ return _PrName;  }
        set
		{
			_PrName = value;
			IsSetPrName = true;
		}
    }
    public bool IsSetPrImage; 
    public bool IsPrImageNullable   
    { 
		get { return false;  } 
    }
    public byte[] PrImage
    {
        get{ return _PrImage;  }
        set
		{
			_PrImage = value;
			IsSetPrImage = true;
		}
    }
    public bool IsSetGroupMenuID; 
    public bool IsGroupMenuIDNullable   
    { 
		get { return false;  } 
    }
    public string GroupMenuID
    {
        get{ return _GroupMenuID;  }
        set
		{
			_GroupMenuID = value;
			IsSetGroupMenuID = true;
		}
    }
    public bool IsSetUnitID1; 
    public bool IsUnitID1Nullable   
    { 
		get { return false;  } 
    }
    public string UnitID1
    {
        get{ return _UnitID1;  }
        set
		{
			_UnitID1 = value;
			IsSetUnitID1 = true;
		}
    }
    public bool IsSetUnitID2; 
    public bool IsUnitID2Nullable   
    { 
		get { return false;  } 
    }
    public string UnitID2
    {
        get{ return _UnitID2;  }
        set
		{
			_UnitID2 = value;
			IsSetUnitID2 = true;
		}
    }
    public bool IsSetNumber; 
    public bool IsNumberNullable   
    { 
		get { return false;  } 
    }
    public double Number
    {
        get{ return _Number;  }
        set
		{
			_Number = value;
			IsSetNumber = true;
		}
    }
    public bool IsSetPrVAT; 
    public bool IsPrVATNullable   
    { 
		get { return false;  } 
    }
    public double PrVAT
    {
        get{ return _PrVAT;  }
        set
		{
			_PrVAT = value;
			IsSetPrVAT = true;
		}
    }
    public bool IsSetPrMadeIn; 
    public bool IsPrMadeInNullable   
    { 
		get { return false;  } 
    }
    public string PrMadeIn
    {
        get{ return _PrMadeIn;  }
        set
		{
			_PrMadeIn = value;
			IsSetPrMadeIn = true;
		}
    }
    public bool IsSetPrPrice_Purchase; 
    public bool IsPrPrice_PurchaseNullable   
    { 
		get { return false;  } 
    }
    public decimal PrPrice_Purchase
    {
        get{ return _PrPrice_Purchase;  }
        set
		{
			_PrPrice_Purchase = value;
			IsSetPrPrice_Purchase = true;
		}
    }
    public bool IsSetPrPrice_AfterVAT; 
    public bool IsPrPrice_AfterVATNullable   
    { 
		get { return false;  } 
    }
    public decimal PrPrice_AfterVAT
    {
        get{ return _PrPrice_AfterVAT;  }
        set
		{
			_PrPrice_AfterVAT = value;
			IsSetPrPrice_AfterVAT = true;
		}
    }
    public bool IsSetPrPrice_RetailSale; 
    public bool IsPrPrice_RetailSaleNullable   
    { 
		get { return false;  } 
    }
    public decimal PrPrice_RetailSale
    {
        get{ return _PrPrice_RetailSale;  }
        set
		{
			_PrPrice_RetailSale = value;
			IsSetPrPrice_RetailSale = true;
		}
    }
    public bool IsSetPrPrice_WholeSale; 
    public bool IsPrPrice_WholeSaleNullable   
    { 
		get { return false;  } 
    }
    public decimal PrPrice_WholeSale
    {
        get{ return _PrPrice_WholeSale;  }
        set
		{
			_PrPrice_WholeSale = value;
			IsSetPrPrice_WholeSale = true;
		}
    }
    public bool IsSetNote; 
    public bool IsNoteNullable   
    { 
		get { return false;  } 
    }
    public string Note
    {
        get{ return _Note;  }
        set
		{
			_Note = value;
			IsSetNote = true;
		}
    }
    public bool IsSetUserNameCreate; 
    public bool IsUserNameCreateNullable   
    { 
		get { return false;  } 
    }
    public string UserNameCreate
    {
        get{ return _UserNameCreate;  }
        set
		{
			_UserNameCreate = value;
			IsSetUserNameCreate = true;
		}
    }
    public bool IsSetDateCreate; 
    public bool IsDateCreateNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateCreate
    {
        get{ return _DateCreate;  }
        set
		{
			_DateCreate = value;
			IsSetDateCreate = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }
    public bool IsSetIsUse; 
    public bool IsIsUseNullable   
    { 
		get { return false;  } 
    }
    public bool IsUse
    {
        get{ return _IsUse;  }
        set
		{
			_IsUse = value;
			IsSetIsUse = true;
		}
    }
    public bool IsSetIsDelete; 
    public bool IsIsDeleteNullable   
    { 
		get { return false;  } 
    }
    public bool IsDelete
    {
        get{ return _IsDelete;  }
        set
		{
			_IsDelete = value;
			IsSetIsDelete = true;
		}
    }

        #endregion

        #region Constructors
        public DM_MENU()
        {
            Reset();
        }
        public DM_MENU(DM_MENU obj)
        {
            	this._PrID = obj.PrID;
	this._ID = obj.ID;
	this._PrName = obj.PrName;
	this._PrImage = obj.PrImage;
	this._GroupMenuID = obj.GroupMenuID;
	this._UnitID1 = obj.UnitID1;
	this._UnitID2 = obj.UnitID2;
	this._Number = obj.Number;
	this._PrVAT = obj.PrVAT;
	this._PrMadeIn = obj.PrMadeIn;
	this._PrPrice_Purchase = obj.PrPrice_Purchase;
	this._PrPrice_AfterVAT = obj.PrPrice_AfterVAT;
	this._PrPrice_RetailSale = obj.PrPrice_RetailSale;
	this._PrPrice_WholeSale = obj.PrPrice_WholeSale;
	this._Note = obj.Note;
	this._UserNameCreate = obj.UserNameCreate;
	this._DateCreate = obj.DateCreate;
	this._IDPOS = obj.IDPOS;
	this._IsUse = obj.IsUse;
	this._IsDelete = obj.IsDelete;
        }
        #endregion

        public void Reset()
        {
                     _PrID = EmptyValues.v_string;
         _ID = EmptyValues.v_string;
         _PrName = EmptyValues.v_string;
         _PrImage = EmptyValues.v_bytes;
         _GroupMenuID = EmptyValues.v_string;
         _UnitID1 = EmptyValues.v_string;
         _UnitID2 = EmptyValues.v_string;
         _Number = EmptyValues.v_double;
         _PrVAT = EmptyValues.v_double;
         _PrMadeIn = EmptyValues.v_string;
         _PrPrice_Purchase = EmptyValues.v_decimal;
         _PrPrice_AfterVAT = EmptyValues.v_decimal;
         _PrPrice_RetailSale = EmptyValues.v_decimal;
         _PrPrice_WholeSale = EmptyValues.v_decimal;
         _Note = EmptyValues.v_string;
         _UserNameCreate = EmptyValues.v_string;
         _DateCreate = EmptyValues.v_DateTime;
         _IDPOS = EmptyValues.v_string;
         _IsUse = EmptyValues.v_bool;
         _IsDelete = EmptyValues.v_bool;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["PrID"] is DBNull))
		{
			obj.PrID = (string)reader["PrID"];
		}
                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (string)reader["ID"];
		}
                if(!(reader["PrName"] is DBNull))
		{
			obj.PrName = (string)reader["PrName"];
		}
                if(!(reader["PrImage"] is DBNull))
		{
			obj.PrImage = (byte[])reader["PrImage"];
		}
                if(!(reader["GroupMenuID"] is DBNull))
		{
			obj.GroupMenuID = (string)reader["GroupMenuID"];
		}
                if(!(reader["UnitID1"] is DBNull))
		{
			obj.UnitID1 = (string)reader["UnitID1"];
		}
                if(!(reader["UnitID2"] is DBNull))
		{
			obj.UnitID2 = (string)reader["UnitID2"];
		}
                if(!(reader["Number"] is DBNull))
		{
			obj.Number = (double)reader["Number"];
		}
                if(!(reader["PrVAT"] is DBNull))
		{
			obj.PrVAT = (double)reader["PrVAT"];
		}
                if(!(reader["PrMadeIn"] is DBNull))
		{
			obj.PrMadeIn = (string)reader["PrMadeIn"];
		}
                if(!(reader["PrPrice_Purchase"] is DBNull))
		{
			obj.PrPrice_Purchase = (decimal)reader["PrPrice_Purchase"];
		}
                if(!(reader["PrPrice_AfterVAT"] is DBNull))
		{
			obj.PrPrice_AfterVAT = (decimal)reader["PrPrice_AfterVAT"];
		}
                if(!(reader["PrPrice_RetailSale"] is DBNull))
		{
			obj.PrPrice_RetailSale = (decimal)reader["PrPrice_RetailSale"];
		}
                if(!(reader["PrPrice_WholeSale"] is DBNull))
		{
			obj.PrPrice_WholeSale = (decimal)reader["PrPrice_WholeSale"];
		}
                if(!(reader["Note"] is DBNull))
		{
			obj.Note = (string)reader["Note"];
		}
                if(!(reader["UserNameCreate"] is DBNull))
		{
			obj.UserNameCreate = (string)reader["UserNameCreate"];
		}
                if(!(reader["DateCreate"] is DBNull))
		{
			obj.DateCreate = (DateTime)reader["DateCreate"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
                if(!(reader["IsUse"] is DBNull))
		{
			obj.IsUse = (bool)reader["IsUse"];
		}
                if(!(reader["IsDelete"] is DBNull))
		{
			obj.IsDelete = (bool)reader["IsDelete"];
		}
//            _PrID = (reader["PrID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PrID"];
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["ID"];
//            _PrName = (reader["PrName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PrName"];
//            _PrImage = (reader["PrImage"] is DBNull)?DalTools.EmptyValues.v_bytes:(byte[])reader["PrImage"];
//            _GroupMenuID = (reader["GroupMenuID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["GroupMenuID"];
//            _UnitID1 = (reader["UnitID1"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UnitID1"];
//            _UnitID2 = (reader["UnitID2"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UnitID2"];
//            _Number = (reader["Number"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Number"];
//            _PrVAT = (reader["PrVAT"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["PrVAT"];
//            _PrMadeIn = (reader["PrMadeIn"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PrMadeIn"];
//            _PrPrice_Purchase = (reader["PrPrice_Purchase"] is DBNull)?DalTools.EmptyValues.v_decimal:(decimal)reader["PrPrice_Purchase"];
//            _PrPrice_AfterVAT = (reader["PrPrice_AfterVAT"] is DBNull)?DalTools.EmptyValues.v_decimal:(decimal)reader["PrPrice_AfterVAT"];
//            _PrPrice_RetailSale = (reader["PrPrice_RetailSale"] is DBNull)?DalTools.EmptyValues.v_decimal:(decimal)reader["PrPrice_RetailSale"];
//            _PrPrice_WholeSale = (reader["PrPrice_WholeSale"] is DBNull)?DalTools.EmptyValues.v_decimal:(decimal)reader["PrPrice_WholeSale"];
//            _Note = (reader["Note"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Note"];
//            _UserNameCreate = (reader["UserNameCreate"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["UserNameCreate"];
//            _DateCreate = (reader["DateCreate"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateCreate"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
//            _IsUse = (reader["IsUse"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["IsUse"];
//            _IsDelete = (reader["IsDelete"] is DBNull)?DalTools.EmptyValues.v_bool:(bool)reader["IsDelete"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string PrID, string ID, string PrName, byte[] PrImage, string GroupMenuID, string UnitID1, string UnitID2, double Number, double PrVAT, string PrMadeIn, decimal PrPrice_Purchase, decimal PrPrice_AfterVAT, decimal PrPrice_RetailSale, decimal PrPrice_WholeSale, string Note, string UserNameCreate, DateTime DateCreate, string IDPOS, bool IsUse, bool IsDelete)
        {
                     this._PrID = PrID;
         this._ID = ID;
         this._PrName = PrName;
         this._PrImage = PrImage;
         this._GroupMenuID = GroupMenuID;
         this._UnitID1 = UnitID1;
         this._UnitID2 = UnitID2;
         this._Number = Number;
         this._PrVAT = PrVAT;
         this._PrMadeIn = PrMadeIn;
         this._PrPrice_Purchase = PrPrice_Purchase;
         this._PrPrice_AfterVAT = PrPrice_AfterVAT;
         this._PrPrice_RetailSale = PrPrice_RetailSale;
         this._PrPrice_WholeSale = PrPrice_WholeSale;
         this._Note = Note;
         this._UserNameCreate = UserNameCreate;
         this._DateCreate = DateCreate;
         this._IDPOS = IDPOS;
         this._IsUse = IsUse;
         this._IsDelete = IsDelete;
        }
    }
}